import Vue from "vue";
import VueRouter from "vue-router";

const originaPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originaPush
    .call(this, location)
    .catch((err) => console.log(err.toString()));
};

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    component: () => import(/* webpackChunkName:"login" */ "@/pages/login"),
  },
  {
    path: "*",
    component: () =>
      import(/* webpackChunkName:"page404" */ "@/pages/Pages404"),
  },
];

const router = new VueRouter({
  routes,
});
export default router;
